﻿using FluentNHibernate.Mapping;
using IapService.Entity;

namespace IapService.Mappings
{
    public class ClientMap : ClassMap<Client>
    {
        public ClientMap()
        {
            Id(x => x.Id);
            Map(x => x.Name);

            HasMany(x => x.Instances)
                .Cascade.Delete()
                .Inverse()
                .KeyColumn("clientId")
                .Not.LazyLoad()
                .AsBag()
                ;
        }
    }
}